/**
 * LocalStorage键名规范
 */
import type { ContentType } from '../../types/document'

export const STORAGE_PREFIX = 'rmzf'

export const buildContentKey = (type: ContentType, id: string): string => {
  return `${STORAGE_PREFIX}:content:${type}:${id}`
}

export const RECENT_DOCUMENTS_KEY = `${STORAGE_PREFIX}:recent:documents`
export const STORAGE_META_KEY = `${STORAGE_PREFIX}:meta:storage`

// 模板系统相关键名
export const TEMPLATE_STORAGE_KEYS = {
  TEMPLATE_PREFIX: `${STORAGE_PREFIX}:template:`,
  TEMPLATE_LIST: `${STORAGE_PREFIX}:templates:list`,
  TEMPLATE_STATS: `${STORAGE_PREFIX}:templates:stats`,
  TEMPLATE_CATEGORIES: `${STORAGE_PREFIX}:templates:categories`,
  TEMPLATE_VERSION: `${STORAGE_PREFIX}:templates:version`
} as const

// 构建单个模板存储键
export const buildTemplateKey = (templateId: string): string => {
  return `${TEMPLATE_STORAGE_KEYS.TEMPLATE_PREFIX}${templateId}`
}
